home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_a
/
chrflp.doc
< prev
next >
Wrap
Text File
|
1995-04-22
|
3KB
|
99 lines
CHRFLP Font Flipper
Bill Aycock [76703,4061]
CHRFLP is an ML subroutine for flipping
between several character sets (fonts)
at regular intervals. You can use as
many fonts as you want, as long as you
have enough room -- each font takes
up 1024 bytes (that's four pages).
The fonts are flipped regularly by a
short interrupt routine called by one
of the software timers -- you control
the speed. Your BASIC program will
continue to run while the character
sets change.
The sample program is pretty basic,
but it shows what you can do. Before
the routine can be used, it must be
placed in the infamous Page Six. (Note
that the assembler code is included so
you can move the routine elsewhere if
desired.)
You also need to set up your alternate
fonts. The sample program reserves
enough space under RAMTOP for four
fonts, then loads them from disk. Note:
the font loader here is S-L-O-W! but
it's easy to understand (and it was
really quick to write! :-)
Remember when you're setting up your
fonts that they MUST START ON AN EVEN
PAGE BOUNDARY! The standard ROM font
starts on page 224 (address $E000).
To make things easier to understand, I
set up two variables as constants.
SETUP has the value 1545, and is the
address to call the setup routine.
CHRFLP has the value 1577; this is the
entry point for the main routine.
Before you start flipping fonts, do a
USR(SETUP). After that, the routine is
controlled with USR calls to CHRFLP.
The format for the USR call is:
X=USR(CHRFLP,sp,set1,set2[,set3...])
where:
CHRFLP is the address of the ML
control routine.
sp is the speed to flip fonts - this
can be from 1 to 255, with 1
being the fastest.
set1 is the HIGH BYTE (MSB) of the
address of your first font.
set2 is the HIGH BYTE (MSB) of the
address of your second font.
set3 is for the third font...
You can use as many fonts as you like,
within reason. Just add the high bytes
of their addresses to the list. If you
want to include the normal ROM font,
just include the number 224 in the
list.
When you've finished, just call the
routine without any parameters at all:
X=USR(CHRFLP)
and the flipping will stop. After you
do this, you can switch to whichever
font you want by POKEing its MSB into
the character set base register:
POKE 756,224
will restore the standard font, but
you can replace the 224 with the MSB
of another font if you wish.
That's the basics. Study the sample
program, try it out, and if you have
any questions be sure to leave me a
message!
Bill Aycock
⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪⓪